<?php
class wj_folders extends Model
{
	// table columns definition
	//! @var id int Sequense name: wj_folders_id_seq
	protected $_id;
	//! @var parent_id int 
	protected $_parent_id;
	//! @var user_id int 
	protected $_user_id;
	//! @var name string 
	protected $_name;
	//! @var descr string 
	protected $_descr;
	//! @var color string 
	protected $_color;
	//! @var x int 
	protected $_x;
	//! @var y int 
	protected $_y;
	//! @var type int 
	protected $_type;
    //! @var access text 
    protected $_access;
    //! @var access_for text 
    protected $_access_for;
    //! @var content text 
    protected $_content;

	// Название Primary Key
	public static $__pKey = Array("id", "user_id");
	// Название Сиквеносв для полей
	public static $__key_pk_seq = Array("id" => "wj_folders_id_seq");
	// Ключь для кеша
	public static $__cached_table = false;
	// Использует запрос на Many Кешь
	public static $__cache_many = true;
	// Поля таблицы и их типы
	public static $__fields = Array(
		 "id" => "int", 
		 "parent_id" => "int", 
		 "user_id" => "int", 
		 "name" => "string", 
		 "descr" => "string", 
		 "color" => "string", 
		 "x" => "int", 
		 "y" => "int",
		 "type" => "int",
         "access" => "string",
         "access_for" => "string",
         "content" => "string"
	);
	// setters
 
    protected $_parent;
    protected function get_parent()
     {
         if ($this->_parent == null)
         {     
             $this->_parent = Worker::fetchObject(wj_folders, array("id" => $this->parent_id));
         }
     }
}

?>